/*
 * ota.h
 *
 *  Created on: May 24, 2020
 *      Author: daniel
 */

#ifndef INC_OTA_OTA_H_
#define INC_OTA_OTA_H_

#include <stdint.h>
#include <stdbool.h>

#include "data_struct.h"

typedef enum
{
	ACTIVE_BANK1,
	ACTIVE_BANK2
}ACTIVE_BANK;

ACTIVE_BANK GetCurrentActiveBank();
void OTASerialDownload();
void CopySwitch();

void OTA_switch();
bool OTA_begin(FIRMWARE_INFO* info, bool* same);
bool OTA_data(uint16_t pos, uint8_t* data, uint8_t length, bool* lastPack);
bool OTA_end();
uint16_t GetOTAPos();

void OTA_reset();

#endif /* INC_OTA_OTA_H_ */
